import { reactive,markRaw } from 'vue'
// 引入全部图标
// import * as Icons from "@element-plus/icons"

// 按需引入图标
import {
  CloseBold,
  Close,
  Plus,
  Star,
  UserFilled,
  Loading,
  Connection,
  Edit,
  FolderOpened,
  Link,
  List,
  Setting,
  Goods,
  Coin,
  User
} from '@element-plus/icons'

const dictIcon = markRaw({
  'CloseBold': CloseBold,
  'Close': Close,
  'Plus': Plus,
  'Star': Star,
  'UserFilled': UserFilled,
  'Loading': Loading,
  'Connection': Connection,
  'Edit': Edit,
  'FolderOpened': FolderOpened,
  'Link': Link,
  'List': List,
  'Setting': Setting,
  'Goods': Goods,
  'Coin': Coin,
  'User': User
})

const installIcon = (app) => {
  // 便于模板获取
  app.config.globalProperties.$icon = dictIcon
  // 使用全部图标
  // app.config.globalProperties.$icon = Icons
}

export default installIcon